package com.aefan.factory.abstractfactory;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 * @Author: jxl
 * @Date: 2021/10/9 下午5:11
 */
public class Test {

    public static void main(String[] args) {
        Provider provider = new AppSendFactory();
        Sender sender = provider.produce();
        sender.send();


        Map<String,Integer> map = new HashMap<>();
        map.put("a",1);
        map.put("b",2);
        map.put("c",3);

        for (String key:map.keySet()) {
            System.out.println("key："+key+" value："+map.get(key));
        }

        System.out.println("-----------------------------------");

        for(Map.Entry<String,Integer> entry:map.entrySet()){
            System.out.println("key："+entry.getKey()+" value："+entry.getValue());
        }

        System.out.println("-----------------------------------");

        Iterator<Map.Entry<String,Integer>> iterator = map.entrySet().iterator();
        while (iterator.hasNext()){
            Map.Entry<String,Integer> entry = iterator.next();
            System.out.println("key："+entry.getKey()+" value："+entry.getValue());
        }

    }

}
